<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui">

<p:dialog id="modalAssentosTrecho" header="Assentos Trecho" hideEffect="fade" resizable="false" minHeight="400" minWidth="665" widgetVar="popupAssentosTrecho" modal="true" style="position: absolute" height="400" width="665">

	<h:panelGroup id="teste">

		<h:form id="formConfigurarAssentosTrecho" rendered="#{!vooMB.trechoBean.possuiAssentos}">

			<p:messages for="formConfigurarAssentosTrecho" autoUpdate="true" />

			<p:panel>
				<div align="center">
					<h:panelGrid columns="4" styleClass="semBorda" columnClasses="colunaEsquerda,colunaDireita">
						<p:outputLabel for="txtQtdAssentos" value="Qtd fileiras:" />
						<p:inputText value="#{vooMB.qtdFileiras}" id="txtQtdAssentos" size="3" maxlength="3" required="true" requiredMessage="Campo Obrigatório" />
						<p:outputLabel for="txtQtdAssentosPrimeiraClasse" value="Qtd fileiras primeira classe" />
						<p:inputText value="#{vooMB.qtdFileirasPrimeiraClasse}" id="txtQtdAssentosPrimeiraClasse" size="3" maxlength="3" required="true" requiredMessage="Campo Obrigatório" />
					</h:panelGrid>
					<p:commandButton id="btSalvar" value="Gerar Matriz Assentos" style="font-size:12px;" action="#{vooMB.gerarMatrizAssentosTrecho}" update=":teste" />
				</div>
			</p:panel>

		</h:form>


		<h:form id="formAssentosTrecho" rendered="#{vooMB.trechoBean.possuiAssentos}">
			<h:outputText value="Legenda: " />
			<p:graphicImage height="20px" style="border:0;" value="/images/imgClasseAssento/1.png"/>
			<h:outputText value="=Assento Primeira Classe  " />
			
			<p:graphicImage height="20px" style="border:0;" value="/images/imgClasseAssento/2.png"/>
			<h:outputText value="=Assento Classe Economica  " />
			<br/>
			
			<p:graphicImage height="20px" style="border:0;" value="/images/imgStatusAssento/0.png"/>
			<h:outputText value="=Assento Livre  " />
			
			<p:graphicImage height="20px" style="border:0;" value="/images/imgStatusAssento/1.png"/>
			<h:outputText value="=Assento Ocupado  " />

			<p:messages for="formAssentosTrecho" autoUpdate="true" />
			<p:panel id="display">
				<p:dataTable id="listaAssentosTrechos" var="assento" paginator="true" rows="20" value="#{vooMB.trechoBean.listaAssentos}">

					<p:column style="text-align:center; width: 30%" rendered="true">
						<f:facet name="header">Código Assento</f:facet>
						<h:outputText value="#{assento.codigo}" />
					</p:column>

					<p:column style="text-align:center; width: 30%" rendered="true">
						<f:facet name="header">Classe Assento</f:facet>
						<p:graphicImage height="20px" style="border:0;" value="/images/imgClasseAssento/#{assento.classeAssento}.png" title="Classe Assento" />
					</p:column>

					<p:column style="text-align:center; width: 30%" rendered="true">
						<f:facet name="header">Status Assento</f:facet>
						<p:graphicImage height="20px" style="border:0;" value="/images/imgStatusAssento/#{assento.statusAssento}.png" title="Status Assento" />
					</p:column>
				</p:dataTable>
			</p:panel>

		</h:form>
	</h:panelGroup>
</p:dialog>
</html>
